package com.eduhzy.ttw.teacher.mvp.model;

import android.app.Application;

import com.eduhzy.ttw.commonsdk.entity.CommonData;
import com.eduhzy.ttw.commonsdk.entity.MineInfo;
import com.eduhzy.ttw.commonsdk.http.CommonApi;
import com.eduhzy.ttw.teacher.mvp.contract.MineContract;
import com.google.gson.Gson;
import com.jess.arms.di.scope.FragmentScope;
import com.jess.arms.integration.IRepositoryManager;
import com.jess.arms.mvp.BaseModel;

import java.util.Map;

import javax.inject.Inject;

import io.reactivex.Observable;


@FragmentScope
public class MineModel extends BaseModel implements MineContract.Model {
    @Inject
    Gson mGson;
    @Inject
    Application mApplication;

    @Inject
    public MineModel(IRepositoryManager repositoryManager) {
        super(repositoryManager);
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        this.mGson = null;
        this.mApplication = null;
    }

    @Override
    public Observable<CommonData<MineInfo>> getUserInfo(Map<String, Object> map) {
        return mRepositoryManager.obtainRetrofitService(CommonApi.class).getUserInfo(map);
    }



}